<template>
    <div>
        <footer>
            <div v-for="(item,index) in list" :class="{active:'/'+item.path==i}" :key="index" @click="cut(item.path)">
                <span :class="`iconfont ${item.icon} `"></span>
                {{item.name}}
            </div>
        </footer>
    </div>
</template>

<script setup>
import { defineProps, ref } from 'vue'
import { useRoute, useRouter } from 'vue-router'
const { path } = useRoute()
const { push } = useRouter()
const i = ref(path)
defineProps(['list'])
const cut = (paths) => {
    i.value = '/' + paths
    if (i == '/' + paths) {
    } else {
        push(paths)
    }

}
</script>

<style lang="scss" scoped>
footer {
    position: fixed;
    left: 0;
    bottom: 0rem;
    width: 100%;
    display: flex;
    justify-content: space-around;
    background-color: #fff;
    overflow: hidden;

    >div {
        padding: 6px;
        flex: 1;
        text-align: center;
        font-size: 20;
        box-sizing: border-box;
    }

    >div>span {
        font-size: 18px;
        display: block;
    }

    .active {
        color: #fe7a03;
    }

}
</style>